| 1. | Socket function mainly realizes setting up and initializing service unit socket , initializing service unit and service unit serial and so on . bind funcion primarily binds local address and port for the socket . listen function is to evaluate the max length of server ’ s listening queue . connect function and accept function set aside rate ahead , infrom user ’ s request of establishing virtual circuit to suna , cooperate with suna to establish the connection between client and server , return the result . we make use of three handshake with data protocol and virtual circuit mode , in this way , when we translate data , we can look up communication course according to virtual circuit number , at the same time , there aren ’ t source ip address and port , end ip address and port in the head of data package , the speed of translating data advances in a certain extent . send function and recv function is to send data collaborating with suna , and copy data from the receiving queue of socket to user ’ s buffer . close function cooperate Socket ( )函数实现创建、初始化服务元套接字,初始化服务元及服务元序列等。 bind ( )函数为套接字绑定本地地址和端口号。 connect ( )和accept ( )函数主要是根据用户要求预留带宽,将用户的建立虚电路请求转达给服务元网络体系,协作服务元网络体系采用捎带数据的三次握手协议建立虚电路,并告诉用户处理结果,一方面,捎带数据的三次握手协议在一定程度上可提高数据传输速度;另一方面,采用虚电路方式,使得数据通信可直接根据虚电路号查找相应的通信进程,而且数据包的包头中省去了源ip地址、端口号和目的ip地址、端口号,提高了数据传输速率。 |